import HttpRequest from '@/libs/axios'
import config from '@/config'

const axios = new HttpRequest()

// 登录获取code
export const getCode = (data) => {
  return axios.request({
    url:
      config.baseUrlSchoolProd +
      '/api/ac/dalianyqschool/qstbMobileService/redirectToDaLian',
    data: data,
    loading: true,
    type: 'get',
  })
}
// 登录通过code获取token
export const getToken = (data) => {
  return axios.request({
    url: '/api/oauth/token',
    data: data,
    loading: true,
    type: 'get',
  })
}
// 登录通过token和user获取user信息
export const getIdentity = (data, user) => {
  return axios.request({
    url: '/api/v2/user/identity/' + user,
    data: data,
    loading: true,
    type: 'get',
  })
}
